package com.lly;




import java.lang.reflect.Method;

public class ClassLoaderTest {

    public static void main(String[] args) {

        try {

            // 初始化加载器
            MyClassLoader myLoader = new MyClassLoader("C:\\Users\\Administrator\\Desktop\\达内\\framework&project\\day02\\ClassLoader");

            // 加载class
            Class c = myLoader.loadClass("com.lly.Test");

            // 验证
            Object obj = c.newInstance();
            Method method = c.getDeclaredMethod("hello", null);
            method.invoke(obj, null);

        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}
